<template>
	<view class="cu-form-group margin-top">
		<view class="title">{{props.title}}</view>
		<picker :mode="props.mode" :value="props.value" :start="props.start" :end="props.end" @change="handleKeyInput">
			<view class="picker">
				{{props.value}}
			</view>
		</picker>
	</view>
</template>

<script setup lang="ts">
	const emit = defineEmits(['action','input']);
	const props = defineProps({
		title: {
			type: String,
			default: '标题'
		},
		value: {
			type: String,
			default: ''
		},
		mode: {
			type: String,
			default: 'date'
		},
		start: {
			type: String,
			default: '2015-09-01'
		},
		end: {
			type: String,
			default: '2020-09-01'
		}
	})
	const handleKeyInput = (e:any) => {
		emit('input', e.target.value)
	}
	const handleClick = (e:any) => {
		emit('action', e)
	}
</script>

<style scoped>
</style>
